package net.adst.util.fileFilters;

import javax.swing.filechooser.FileFilter;
import java.io.File;

/**
 * Created with IntelliJ IDEA.
 * User: alekseipot
 * Date: 22.11.12
 * Time: 3:27
 * To change this template use File | Settings | File Templates.
 */
public class MSExcelFilter extends FileFilter {
    public boolean accept(File file) {
        int position = file.getName().lastIndexOf(".");
        String filename = file.getName().substring(position + 1);
        return filename.contains("xls") && !filename.contains("xlsx");
    }

    public String getDescription() {
        return "MS Excel files (*xls)";
    }
}
